package net.game.server.util.crypto;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

import java.io.IOException;

public class BASE64 {
    
    public static String encode(String s) {
        return new BASE64Encoder().encode(s.getBytes());
    }
    
    public static String decode(String s) {
        try {
            return new String(new BASE64Decoder().decodeBuffer(s));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "";
    }
}
